package ccmouse.guice.v12.helloworlddemo;

import ccmouse.guice.v12.MyAppletV6;

public class StringWritingAppletV2 implements MyAppletV6 {

    private MyDestinationV3 destination;
    private StringProvider stringProvider;

    public StringWritingAppletV2(MyDestinationV3 destination,
                                 StringProvider stringProvider) {
        this.destination = destination;
        this.stringProvider = stringProvider;
    }

    private void writeString() {
        destination.write(stringProvider.get());
    }

    @Override
    public void run() {
        writeString();
    }
}
